import request from '@/utils/request'

export function getLeaveBillList(query){
    return request({
        url:"/leavebill/list",
        method:"get",
        params:query
    }); 
}

// 保存新增的请假单信息
export function saveLeaveBill(data) {
    return request({
      url: '/leavebill/saveLeaveBill',
      method: 'post',
      data
    })
}

// 通过请假单ID查询请假单的详情对象信息
export function getLeaveById(id) {
    return request({
        url: `/leavebill/getLeaveById/${id}`,
        method: 'get'
    })
}
// 保存修改后的请假信息
export function updateLeaveBill(data) {
    return request({
        url: '/leavebill/updateLeaveBill',
        method: 'post',
        data
    })
}
  
// 删除请假单
export function delLeave(id) {
    return request({
      url: `/leavebill/delLeaveBill/${id}`,
      method: 'get'
    })
}
  
// 批量删除请假单信息
export function batchDeleteLeaveBill(ids) {
    return request({
      url: '/leavebill/batchDeleteLeaveBill',
      method: 'get',
      params: { 'ids': ids }
    })
}


// 提交请假单申请
export function startProcess(id) {
    return request({
      url: `/workFlow/startProcess/${id}`,
      method: 'get'
    })
}
